package com.kayt.cyberBar.cpublic.business.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kayt.cyberBar.common.PageData;
import com.kayt.cyberBar.common.ServerResponse;
import com.kayt.cyberBar.cpublic.business.entity.po.CPublicTaskLevel;
import com.kayt.cyberBar.cpublic.business.entity.req.vo.PublicTaskLevelReqVO;
import com.kayt.cyberBar.cpublic.business.entity.rsp.vo.PublicTaskLevelRspVO;
import com.kayt.cyberBar.cpublic.business.server.IPublicTaskLevelServer;
import com.kayt.cyberBar.cpublic.business.service.IPublicTaskLevelService;

@Service("publicTaskLevelService")
public class PublicTaskLevelServiceImpl implements IPublicTaskLevelService{
	@Autowired
	private IPublicTaskLevelServer publicTaskLevelServer;
	@Override
	public ServerResponse<PageData<PublicTaskLevelRspVO>> getTaskLevelList() {
		PageData<CPublicTaskLevel> taskLevelPageData = publicTaskLevelServer.get_taskLevel_list();
		return publicTaskLevelServer.assemble_result_list(taskLevelPageData);
	}

	@Override
	public ServerResponse<PublicTaskLevelRspVO> addTaskLevel(PublicTaskLevelReqVO taskLevelReqVO) {
		CPublicTaskLevel taskLevel = publicTaskLevelServer.add_TaskLevel(taskLevelReqVO);
		return publicTaskLevelServer.assemble_result(taskLevel);
	}

	@Override
	public ServerResponse<PublicTaskLevelRspVO> updateTaskLevel(PublicTaskLevelReqVO taskLevelReqVO) {
		CPublicTaskLevel taskLevel = publicTaskLevelServer.mod_taskLevel(taskLevelReqVO);
		return publicTaskLevelServer.assemble_result(taskLevel);
	}

	@Override
	public ServerResponse<String> deleteTaskLevel(String taskLevelId) {
		Integer result = publicTaskLevelServer.del_taskLevel(taskLevelId);
		return publicTaskLevelServer.assemble_result_string(result);
	}
}
